package xcmg.device.dao.mapper.basic;

import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import xcmg.device.dao.entity.basic.MaterialsPurchaseInfo;

/**
 * @author wangyong
 */
@Mapper
public interface MaterialsPurchaseInfoMapper {

  /**
   * 获取零件的所有供应商信息
   *
   * @param orgId
   * @param materialsNo
   * @return
   */
  List<MaterialsPurchaseInfo> listMaterialsPurchaseInfo(@Param("orgId") String orgId, @Param("materialsNo")String materialsNo);

  /**
   * 获取该零件的交货花费时间（多个供应商取最小值）
   *
   * @param orgId
   * @param materialsNo
   * @return
   */
  MaterialsPurchaseInfo getMinDeliverySpend(@Param("orgId") String orgId, @Param("materialsNo")String materialsNo);

  /**
   * 删除零件供应商信息
   *
   * @param orgId
   * @param materialsNo
   * @return
   */
  Integer delete(@Param("orgId") String orgId, @Param("materialsNo")String materialsNo);

  /**
   * 保存零件供应商信息
   *
   * @param materialsPurchaseInfo
   * @return
   */
  Integer insert(MaterialsPurchaseInfo materialsPurchaseInfo);

  List<MaterialsPurchaseInfo> selectByOrgIdAndMaterialNoAndSupplierCode(@Param("materialNo") String materialNo,@Param("orgId")String orgId,@Param("supplierCode")String supplierCode);


}
